import { DependencyContainer, InjectionToken, container } from "tsyringe";

export function tryGetAll<T>(token: InjectionToken<T>, injector?: DependencyContainer): T[] {
    try {
        if(injector) return injector.resolveAll(token)
        return container.resolveAll(token)
    } catch (e) {
        return []
    }
}
